<%-- 
    Document   : Admin
    Created on : May 21, 2013, 1:16:12 AM
    Author     : TuPA
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<jsp:useBean id="marshallXMLs" class="Model.marshallXML" scope="request"></jsp:useBean>
<% marshallXMLs.marshalProduct(application.getRealPath("/") + "XML/products.xml");

%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin Dashboard</title>
        <link rel="stylesheet" href="css/styleAdmin.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="css/admin.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="css/colour.css" type="text/css" media="screen" charset="utf-8" />
        <script type="text/javascript" src="js/admin.js"></script>
        <script type="text/javascript" src="js/catchError.js"></script>
        <script type="text/javascript" src="js/orders.js"></script>
    </head>
    <body>
        <c:if test="${username=='admin'}">
        <h1 id="head" style="font-size: 40px;">Admin Dashboard
            <div style="float: right; font-size: 17px; font-style: italic; font-weight: lighter">
                <c:if test="${ not empty username}"><a href="#" style="color:wheat">Hello,${username}</a> | <a href="logout.jsp" style="color:wheat">Log Out</a></c:if>
                <c:if test="${empty username}"><a href="login.jsp">Log In</a> |</c:if>
            </div>
        </h1>

        <ul id="navigation">
            <li><span class="active"><a href="Admin.jsp">Products</a></span></li>
            <li><span class="active"><a href="#" onclick="loadOrders()">Orders</a></span></li>
        </ul>

        <div id="content" class="container_16 clearfix">
            <c:import url="XML/products.xml" charEncoding="UTF-8" var="xmldoc"/>
            <c:import url="xsl/Admin.xsl" charEncoding="UTF-8" var="xsldoc"/>
            <x:transform xml="${xmldoc}" xslt="${xsldoc}"/>
        </div>
</c:if>
        <c:if test="${username!='admin'}"><c:redirect url="login.jsp" /></c:if>
    </body>
</html>
